package org.sample.springboot.mocker;

import org.sample.springboot.model.Account;
import org.sample.springboot.web.AccountRequest;

import java.util.function.Consumer;

public class AccountRequestMocker {

	private AccountRequestMocker() {

	}

	public static interface AccountRequestPropMocker extends Consumer<AccountRequest> {

	}

	public static AccountRequest mock(AccountRequestPropMocker... propMockers) {
		AccountRequest obj = new AccountRequest();

		for (AccountRequestPropMocker propSetter : propMockers) {
			propSetter.accept(obj);
		}

		return obj;
	}

	public static AccountRequestPropMocker account(Account account) {
		return obj -> obj.setAccount(account);
	}

}
